﻿<%@ Page Title="Thumbnail" Language="C#" MasterPageFile="~/Posts/Posts.master" AutoEventWireup="true" CodeFile="Thumbnail.aspx.cs" Inherits="Posts_Thumbnail" %>
<%@ Register Src="Header.ascx" TagPrefix="uc" TagName="Header"  %>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <uc:Header id="ucHeader" runat="server" />
    <asp:Panel ID="Panel1" CssClass="tabPage clearfix" runat="server">
        <div class="actionButtons clearfix">
            <div class="floatRight">
                    <acms:ActionButton ID="lnkEdit" Icon="Edit" ToolTip="Edit The Nodes Details." Text="Edit" runat="server" onclick="lnkEdit_Click"/>
                    <acms:ActionButton ID="lnkSave" Icon="Save" ToolTip="Save Changes." Text="Save" onclick="lnkSave_Click" runat="server"/>
                    <acms:ActionButton ID="lnkCancel" Icon="Cancel" ToolTip="Cancel Changes." Text="Cancel" onclick="lnkCancel_Click" runat="server"/>
            </div>
        </div>
        <asp:DetailsView ID="dvPost" DataSourceID="dsPost" DataKeyNames="Id, ConcurencyId" AutoGenerateRows="false" runat="server">
            <Fields>
                <acms:TextAreaField DataField="Summary" Rows="5" Cols="50" HeaderText="Summary" />
                <asp:TemplateField HeaderText="Thumbnail">
                    <ItemTemplate>
                        <asp:Panel ID="pnlThumbs" Visible='<%#((Acms.Bll.Post)Container.DataItem).ThumbnailId.HasValue%>' Width="100%" runat="server">
                            <div style="float:left;width:24.5%">
                                <span>150x150</span>
                                <div style="text-align:center">  
                                    <acms:AcmsImage ID="img150150" RenderHeight="150" RenderWidth="150" FileId='<%#Eval("ThumbnailId") %>' runat="server" />
                                </div>
                            </div>
                            <div style="float:left;width:24.5%">
                                <span>100x100</span>
                                <div style="text-align:center">  
                                    <acms:AcmsImage ID="img100100" RenderHeight="100" RenderWidth="100" FileId='<%#Eval("ThumbnailId") %>' runat="server" />
                                </div>
                            </div>
                            <div style="float:left;width:24.5%">
                                <span>50x50</span>
                                <div style="text-align:center">  
                                    <acms:AcmsImage ID="img5050" RenderHeight="50" RenderWidth="50" FileId='<%#Eval("ThumbnailId") %>' runat="server" />
                                </div>
                            </div>
                            <div style="float:left;width:24.5%">
                                <span>25x25</span>
                                <div style="text-align:center">  
                                    <acms:AcmsImage ID="img2525" RenderHeight="25" RenderWidth="25" FileId='<%#Eval("ThumbnailId") %>' runat="server" />
                                </div>
                            </div>
                        </asp:Panel>
                        <div class="clearBoth"></div>
                        <asp:Panel ID="pnlNoThumb" runat="server" Visible='<%#!((Acms.Bll.Post)Container.DataItem).ThumbnailId.HasValue%>' CssClass="ImportantText">
                            <p>This post does not have a thumbnail.</p>
                        </asp:Panel>
                    </ItemTemplate>                
                    <EditItemTemplate>
                        <asp:Panel ID="pnlUploadThumb" runat="server">
                            <asp:Panel ID="pnlThumb" runat="server" Visible='<%#((Acms.Bll.Post)Container.DataItem).ThumbnailId.HasValue%>' CssClass="ImportantText">
                                <p>Leave Blank to use existing thumnail.</p>
                            </asp:Panel>
                            <asp:FileUpload ID="upload" runat="server" />
                            <asp:Panel ID="pnlThumb2" runat="server" Visible='<%#((Acms.Bll.Post)Container.DataItem).ThumbnailId.HasValue%>' CssClass="ImportantText">
                                <p>To Remove a thumnail with out uploading a replacment check here <asp:CheckBox ID="cboRemove" onclick="javascript:if(this.checked){this.checked = confirm('Are you sure you want to delete this thumbnail?');}" EnableViewState="false" runat="server" />.</p>
                            </asp:Panel>
                        </asp:Panel>
                    </EditItemTemplate>
                </asp:TemplateField>
            </Fields>
        </asp:DetailsView>
        <acms:PostDataSource ID="dsPost" runat="server" />
   </asp:Panel>
</asp:Content>

